home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
doom
/
server_1.zip
/
_LIGHTNG.QC
< prev
next >
Wrap
Text File
|
1996-10-04
|
2KB
|
78 lines
/*
**
** _lightng.qc (Lightning Code , 1.1)
**
** Copyright (C) 1996 Johannes Plass
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Author: Johannes Plass (plass@dipmza.physik.uni-mainz.de)
**
*/
void(entity player) LightningInit =
{
if (!USE_MODULE_LIGHTNING) return;
// nothing to be done here.
};
void(entity player) LightningInfo =
{
if (!USE_MODULE_LIGHTNING) return;
// 123456789#123456789#123456789#12345678
sprint(player,"£");
sprint(player," Lightning");
sprint(player, " reduces the effect of\n");
sprint(player," underwater discharges.\n");
};
void(entity player) LightningActiveMessage =
{
if (!USE_MODULE_LIGHTNING) return;
// 123456789#123456789#123456789#12345678
sprint(player," Lightning\n");
};
void(entity player,vector target_pos) LightningMakeNoise =
{
local float ddd, sss;
if (player.lightning_sound_lasttime < 0) sss = 1;
else if (player.lightning_sound_nexttime < time) sss = 1;
if (time >= player.lightning_sound_lasttime + 0.1) {
ddd = vlen(target_pos - player.lightning_target);
if (ddd > 10) {
if (random() > 0.3) sss = 2;
}
}
if (sss) {
if (sss == 2) {
sound (player, CHAN_WEAPON, "weapons/lstart.wav", 1, ATTN_NORM);
player.lightning_sound_nexttime = time + 0.6;
}
else if (sss == 1) {
sound (player, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
player.lightning_sound_nexttime = time + 0.6;
}
player.lightning_sound_lasttime = time;
player.lightning_target = target_pos;
}
};